Method and apparatus for encoding intra prediction information

ABSTRACT

A method for encoding an intra prediction mode according to the present invention selects an intra prediction mode for a current block, determines the number of valid MPM candidates by checking the validity of MPM candidates of the current block, and if the number of valid MPM candidates is less than a previously set number, adds additional intra prediction modes as MPM candidates. MPM candidates can be adaptively added on the basis of the directionality of valid MPM candidates. Additionally, during the encoding of residual intra prediction modes, residual intra prediction modes are realigned on the basis of the directionality of valid MPM candidates. Accordingly, the present invention minimizes the information for encoding the intra prediction mode of the current block by adding MPM candidates or realigning the residual intra prediction modes on the basis of the directionality of valid MPM candidates.

CROSS-REFERENCE TO RELATED PATENT APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.14/124,625, filed Apr. 10, 2014, which is a 35 U.S.C. §371 nationalstage filing of International Application No. PCT/KR2012/003075, filedApr. 20, 2012, which claims the benefit of Korean Patent Application No.10-2011-0108452, filed on Oct. 24, 2011. The contents of each of theforegoing applications are incorporated herein by reference in theirentireties.

TECHNICAL FIELD

The present invention relates to an intra prediction informationencoding method and an intra prediction information encoding device, andmore particularly, to a method and a device that creates an MPM groupusing intra prediction modes of left and top blocks of a current block,determines intra prediction information of the current block using theintra prediction mode of the current block and the MPM group, andencodes the intra prediction information.

BACKGROUND ART

Image data has to be encoded to efficiently store or transmit the imagedata. MPEG-1, MPEG-2, MPEG-4, H.264/MPEG-4 AVC (Advanced Video Coding),and the like are known as techniques of encoding image data. In thesetechniques, a picture is divided into macro blocks, it is determinedwhich of intra encoding or inter encoding should be performed in theunit of the macro blocks, and the macro blocks are encoded using thedetermined encoding method.

In H.264 which is a latest image compressing technique, intra predictionis performed to enhance the efficiency of the intra encoding. That is,instead of referring to a reference picture to encode a current block, aprediction block is created using pixel values spatially neighboring thecurrent block to be encoded. Specifically, an intra prediction modehaving a small distortion is selected through comparison with anoriginal macro block using the neighboring pixel values and theprediction block of the current block to be encoded is created using theselected intra prediction mode and the neighboring pixel values. Aresidual block including difference signals between the current blockand the prediction block is created and the residual block istransformed, quantized, and entropy-encoded. The intra prediction modeused to create the prediction block is also encoded.

However, in H.264, the intra prediction mode of a current block isencoded regardless of directivity of the intra prediction modes of theleft and top blocks of the current block and there is thus a problem inthat the encoding efficiency is low. When the number of intra predictionmodes increases to enhance the encoding efficiency of a residual block,there is a need for an intra prediction encoding method havingefficiency higher than that of the intra prediction mode encoding methodof H.264.

SUMMARY OF THE INVENTION Technical Problem

An object of the invention is to provide a method and a device which canreduce the number of bits required for encoding an intra prediction modeof the current block by creating an MPM group using intra predictionmodes of left and top blocks of a current block and using the MPM groupto enhance compression efficiency of an image.

Solution to Problem

According to an aspect of the invention, there is provided an intraprediction information encoding method including: determining an intraprediction mode of a current block; constructing a first group usingvalid intra prediction modes of left and top blocks of the currentblock; determining an intra prediction mode group indicator and aprediction mode index of the current block using the intra predictionmode of the current block and the first group; and encoding theprediction modes index using a method varying depending on the intraprediction mode group indicator.

In the intra prediction information encoding method, a method ofbinarizing the prediction mode index may vary depending on the intraprediction mode group indicator.

In the intra prediction information encoding method, when the intraprediction mode group indicator indicates the first group, theprediction mode index may be binarized in a truncated unary manner andmay then be entropy-encoded.

In the intra prediction information encoding method, the first group mayinclude three intra prediction modes. When the intra prediction modes ofthe left and top blocks of the current block are not valid, the firstgroup may include a planar mode, a DC mode, and a vertical mode.

Advantageous Effects

The intra prediction information encoding method according to theinvention includes determining an intra prediction mode of a currentblock, constructing a first group using valid intra prediction modes ofleft and top blocks of the current block, determining an intraprediction mode group indicator and a prediction mode index of thecurrent block using the intra prediction mode of the current block andthe first group, and encoding the prediction modes index using a methodvarying depending on the intra prediction mode group indicator.

Therefore, it is possible to reduce the amount of information of theintra prediction mode to be encoded, by causing the first group toinclude modes having a high possibility of matching the intra predictionmode of the current block depending on the valid intra prediction modesof the left and top blocks of the current block and determining theintra prediction mode group indicator and the prediction mode index tobe encoded of the current block using the first group. In addition, itis possible to enhance the encoding efficiency of the intra predictionmode by changing the method of encoding the prediction mode indexdepending on the intra prediction mode group indicator.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating a moving image encoding deviceaccording to an embodiment of the invention.

FIG. 2 is a block diagram illustrating a moving image decoding deviceaccording to another embodiment of the invention.

FIG. 3 is a diagram illustrating a method of creating an intraprediction block in the moving image decoding device according to theembodiment of the invention.

FIG. 4 is a conceptual diagram illustrating intra prediction modesaccording to the embodiment of the invention.

DESCRIPTION OF EXEMPLARY EMBODIMENTS

Hereinafter, various embodiments of the invention will be described indetail with reference to the accompanying drawings. The invention can bemodified in various forms and can have various embodiments. Theembodiments are not intended for limiting the invention, but it shouldbe understood that the invention includes all the modifications,equivalents, and replacements belonging to the spirit and the technicalscope of the invention. In description of the invention with referenceto the drawings, like constituents are referenced by like referencenumerals.

A moving image encoding device and a moving image decoding deviceaccording to the invention may be user terminals such as a personalcomputer, a notebook PC, a personal digital assistant, a portablemultimedia player, a smart phone, a wireless communication terminal, anda TV or servers providing services. The moving image encoding device andthe moving image decoding device may be apparatuses having acommunication device such as a communication modem for communicatingwith various apparatuses or wireless or wired communication networks, amemory storing various programs and data for encoding and decoding animage, and a microprocessor performing the programs to performoperations and controls.

FIG. 1 is a block diagram illustrating a moving image encoding deviceaccording to an embodiment of the invention.

The moving image encoding device 100 according to the embodiment of theinvention includes an intra prediction module 110, an inter predictionmodule 120, a transform and quantization module 130, an entropy encodingmodule 140, an inverse quantization and inverse transform module 150, apost-processing module 160, a picture buffer 170, a subtraction module190, and an addition module 195.

The intra prediction module 110 creates an intra prediction block usingreconstructed pixels of a picture or slice to which a current blockbelongs. The intra prediction module 110 selects one of a predeterminednumber of intra prediction modes depending on the size of the currentblock to be prediction-encoded and creates a prediction block dependingon the selected intra prediction mode.

The inter prediction module 120 performs a motion estimation operationusing reference pictures stored in the picture buffer 170 and determinesreference picture indices and motion vectors for the motion estimationoperation. Then, the inter prediction module 120 creates an interprediction block of the current block using the reference pictureindices and the motion vectors.

The transform and quantization module 130 transforms and quantizes aresidual block of the prediction block created by the intra predictionmodule 110 or the inter prediction module 120. The transform isperformed using one-dimensional transform matrixes in the horizontal andvertical directions. The residual block for intra prediction istransformed using transform matrixes determined depending on the size ofthe transform block (that is, the size of the residual block) and theintra prediction mode. The residual block for inter prediction istransformed using predetermined transform matrixes.

The transform and quantization module 130 quantizes the transform blockusing a quantization step size. The quantization step size can bechanged by coding units equal to or larger than a predetermined size.

The quantized transform block is supplied to the inverse quantizationand inverse transform module 150 and the entropy encoding module 140.

The inverse quantization and inverse transform module 150 inverselyquantizes the quantized transform block and inversely transform theinversely-quantized transform block to reconstruct the residual block.The addition module adds the residual block reconstructed by the inversequantization and inverse transform module 150 and the prediction blockfrom the intra prediction module 110 or the inter prediction module 120to creates a reconstructed block.

The post-processing module 160 serves to improve image quality of thereconstructed picture and includes a deblocking filter module 161, anoffset module 162, and a loop filter module 163.

The deblocking filter module 161 adaptively applies a deblocking filterto boundaries of the prediction block and the transform block. Theboundaries can be limited to boundaries of 8×8 grids. The deblockingfilter module 161 determines the boundaries to be filtered, determinesboundary strengths thereof, and determines whether the deblocking filtershould be applied to the boundaries when the boundary strength is largerthan 0. When it is determined that the boundaries should be filtered,the deblocking filter module 161 selects a filter to be applied to theboundaries and filters the boundaries with the selected filter.

The offset module 162 determines whether an offset should be applied bypictures or slices so as to reduce the distortion between a pixel in theimage undergoing the deblocking filter module and a correspondingoriginal pixel. Alternatively, a slice is divided into plural offsetareas and the offset type of each offset area can be determined. Theoffset type may include a predetermined number of edge offset types andband offset types. When the offset type is an edge offset type, the edgetype to which each pixel belongs is determined and an offsetcorresponding thereto is applied. The edge type is determined on thebasis of the distribution of two pixel values neighboring a currentpixel.

The loop filter module 163 adaptively loop-filters the reconstructedimage on the basis of the comparison result of the reconstructed imageundergoing the offset module 162 with the original image. It isdetermined whether the reconstructed image should be loop-filtered bycoding units. The size and coefficients of the loop filter to be appliedmay changed by the coding units. Information indicating whether theadaptively loop filter should be applied by coding units may be includedin each slice header. In case of a chroma signal, it can be determinedwhether the adaptive loop filter should be applied by pictures.Therefore, information indicating whether chroma components are filteredmay be included in a slice header or a picture header.

The picture buffer 170 receives post-processed image data from thepost-processing module 160 and reconstructs and stores an image in theunit of pictures. The picture may be an image in the unit of frames oran image in the unit of fields.

The entropy encoding module 140 entropy-encodes the quantizationcoefficient information quantized by the transform and quantizationmodule 130, the intra prediction information received from the intraprediction module 140, the motion information received from the interprediction unit 150, and the like. The entropy encoding module 140includes a scanning module 145 which is used to transform coefficientsof the quantized transform block into one-dimensional quantizationcoefficients.

The scanning module 145 determines a scanning type for transforming thecoefficients of the quantized transform block into one-dimensionalquantization coefficients. The scanning type may vary depending on adirectional intra prediction mode and the size of a transform block. Thequantization coefficients are scanned in the backward direction.

When the quantized transform block is larger than a predetermined size,the transform coefficients are divided into plural sub blocks and arescanned. The scanning types applied to the transform coefficients of thesub blocks are the same. The scanning types applied to the sub blocksmay be a zigzag scan or may be the same scanning types as applied to thetransform coefficients of the sub blocks.

FIG. 2 is a block diagram illustrating a moving image decoding device200 according to an embodiment of the invention.

The moving image decoding device 200 according to the embodiment of theinvention includes an entropy decoding module 210, an inversequantization module 220, an inverse transform module 230, an intraprediction module 240, an inter prediction module 250, a post-processingmodule 260, a picture buffer 270, and an addition module 280.

The entropy decoding module 210 decodes a received bit stream andseparates the bit stream into intra prediction information, interprediction information, quantization coefficient information, and thelike therefrom. The entropy decoding module 210 supplies the decodedintra prediction information to the intra prediction module 240 andsupplies the decoded inter prediction information to the interprediction module 250. The entropy decoding module 210 includes aninverse scanning module 215 for inversely scanning the decodedquantization coefficient information.

The inverse scanning module 215 converts the quantization coefficientinformation into a two-dimensional quantization block. One of pluralscanning types is selected for the conversion. The scanning type mayvary depending on a directional intra prediction mode and the size of atransform block. The quantization coefficients are scanned in thebackward direction. When the quantized transform block is larger than apredetermined size, the coefficients are divided into plural sub blocksand are scanned. The scanning types applied to the transformcoefficients of the sub blocks are the same. The scanning types appliedto the sub blocks may be a zigzag scan or may be the same scanning typesas applied to the transform coefficients of the sub blocks.

The inverse quantization module 220 determines a quantization step sizepredictor of a current coding unit and adds the determined quantizationstep size predictor to the received residual quantization step size toreconstruct the quantization step size of the current coding unit. Theinverse quantization module 220 inversely quantizes the quantizationblock using the quantization step size and the inverse quantizationmatrix. The quantization matrix is determined depending on the size ofthe quantization block and the prediction mode. That is, thequantization matrix is selected on the basis of at least one of theprediction mode of the current block and the intra prediction modes forthe quantization block having a predetermined size.

The inverse transform module 230 inversely transforms theinversely-quantized transform block to reconstruct a residual block. Theinverse transform matrix to be applied to the inverse quantization blockcan be determined depending on the prediction mode and the intraprediction mode.

The addition module 280 adds the prediction block created by the intraprediction module 240 or the inter prediction module 250 to the residualblock reconstructed by the inverse transform module 230 to create areconstructed block.

The intra prediction module 240 reconstructs the intra prediction modeof the current block on the basis of the intra prediction informationreceived from the entropy decoding module 210. Then, the intraprediction module 240 creates a prediction block depending on thereconstructed intra prediction mode.

The inter prediction module 250 reconstructs the reference picture indexand the motion vector on the basis of the inter prediction informationreceived from the entropy decoding module 210. Then, the interprediction module 250 creates a prediction block of the current blockusing the reference picture index and the motion vector. When motioncompensation with decimal prediction is applied, the selectedinterpolation filter is applied to create the prediction block.

The operation of the post-processing module 260 is the same as theoperation of the post-processing module 160 shown in FIG. 1 and thuswill not be described again.

The picture buffer 270 stores the decoded image post-processed by thepost-processing module 260 in the unit of pictures.

FIG. 3 is a diagram illustrating a method of creating an intraprediction block according to the embodiment of the invention.

First, the intra prediction information from the received bit stream isentropy-decoded (S110).

The intra prediction information includes the intra prediction modegroup indicator and the prediction mode index. The intra prediction modegroup indicator indicates whether the intra prediction mode of thecurrent block belongs to an MPM group or a group other than the MPMgroup. The prediction mode index is information indicating a specificintra prediction mode in the intra prediction mode group indicated bythe intra prediction mode group indicator.

The intra prediction mode group indicator can be received in the form ofunsigned integer. In this case, the intra prediction mode groupindicator can be used without being entropy-decoded. Alternatively, theintra prediction mode group indicator may be adaptively entropy-encodeddepending on the type of a current slice. For example, the intraprediction mode group indicator may be entropy-encoded using contextsdetermined depending on the slice type. Therefore, the intra predictionmode group indicator may be decoded using the contexts determineddepending on the type of the current slice. The entropy-encoding methodof the prediction mode index varies depending on whether the intraprediction mode belongs to the MPM group or not. Therefore, theprediction mode index is entropy-decoded using different methods.

Specifically, when the intra prediction mode group indicator representsthat the intra prediction mode of the current block belongs to the MPMgroup, the prediction mode index is binarized in a truncated Exp-Golombcode manner or a truncated unary manner and is then entropy-encoded.Therefore, after the binary information is acquired by performing theentropy decoding, the prediction mode index is reconstructed using theabove-mentioned methods. When the intra prediction mode group indicatorrepresents that the intra prediction mode of the current block does notbelong to the MPM group, the prediction mode index can be binarized witha fixed length. Therefore, after the binary information is acquired byperforming the entropy decoding, the prediction mode index can bereconstructed.

Then, the MPM group is created using the intra prediction modes of theblocks neighboring the current block and then the intra prediction modeof the current block is reconstructed using the MPM group (S120). TheMPM group includes three intra prediction modes. This will be describedwith reference to FIG. 4. FIG. 4 is a diagram illustrating intraprediction modes according to an embodiment of the invention.

(1) When the intra prediction modes of the top and left blocks of acurrent block are both present and are different from each other, theMPM group includes the two intra prediction modes and one additionalintra prediction mode.

When one of the two intra prediction modes is a DC mode and the other isnot a planar mode, the additional intra prediction mode may be theplanar mode. Similarly, when one of the two intra prediction modes isthe planar mode and the other is not the DC mode, the additional intraprediction mode may be the DC mode.

When the two intra prediction modes are the DC mode and the planar mode,the additional intra prediction mode may be a vertical mode or ahorizontal mode.

When the two intra prediction modes are not the DC mode nor the planarmode, the additional intra prediction mode may be an intra predictionmode having directionality between the two intra prediction modes, orthe DC mode or the planar mode.

(2) When the intra prediction modes of the top and left blocks of thecurrent block are both present and are equal to each other, the MPMgroup includes the intra prediction mode and two additional intraprediction modes.

When the intra prediction mode is neither the DC mode nor the planarmode, the two additional intra prediction modes are set to two intraprediction modes neighboring the intra prediction mode. When the intraprediction mode is the DC mode, the two additional intra predictionmodes may be the planar mode and the vertical mode.

(3) When only one of the intra prediction modes of the top and leftblocks of the current block is present, the MPM group includes the intraprediction mode and two additional intra prediction modes. The twoadditional intra prediction modes are determined depending on the intraprediction mode.

(4) When the intra prediction modes of the top and left blocks of thecurrent block are not present at all, the MPM group includes the DCmode, the planar mode, and the vertical mode.

When the intra prediction mode group indicator indicates the MPM group,the intra prediction mode indicated by the prediction mode index isselected from the MPM group and the selected intra prediction mode isdetermined as the intra prediction mode of the current block. The intraprediction mode group indicator may be flag information representingwhether the intra prediction mode of the current block belongs to theMPM group or a group other than the MPM group.

When the intra prediction mode group indicator does not indicates theMPM group, the intra prediction module 240 determines the intraprediction mode indicated by the prediction mode index out of the intraprediction modes (hereinafter, referred to as residual intra predictionmodes) other than the intra prediction modes belonging to the MPM groupas the intra prediction mode of the current block. The prediction modeindices assigned to the residual intra prediction modes vary dependingon the configuration of the MPM group. That is, the decoded predictionmode indices indicate indices of the residual intra prediction modesrearranged depending on the configuration of the MPM group. Therefore,the intra prediction module 240 selects the intra prediction mode of thecurrent block from the residual intra prediction modes depending on thedecoded prediction mode index and the intra prediction modes belongingto the MPM group.

Specifically, the residual intra prediction modes of the current blockare rearranged in the mode number order and the intra prediction modecorresponding to the received prediction mode index is selected as theintra prediction mode of the current block. In this case, the residualintra prediction modes may be rearranged, but the intra prediction modeof the current block may be determined by comparison of the intraprediction mode numbers belonging to the MPM group with the intraprediction mode index of the current block.

This method can be applied to a case where mode number 2 is assigned tothe DC mode of the non-directional modes, mode number 34 is assigned tothe planar mode, and directional mode numbers are assigned to the othermodes. However, since the probability of selecting the planar mode andthe DC mode as the intra prediction mode of the current is higher thanthose of the other directional modes, a small mode number (for example,mode number 0) is assigned to the planar mode and the above-mentionedmethod can be applied. In this case, the mode numbers of the otherlower-ranked modes increase by 1.

Alternatively, the lowest indices may be assigned to the non-directionalmodes. For example, when the intra prediction mode of the current blockis the planar mode and the residual intra prediction modes include theplanar mode, the intra prediction mode index may include 0. For example,when the residual intra prediction modes include the planar mode and theDC mode, the intra prediction mode corresponding to the prediction modeindex in a state where the planar mode, the DC mode, and the directionalmodes are arranged in this order may be set as the intra prediction modeof the current block. For example, mode number 0 and mode number 1 maybe assigned to the planar mode the DC mode, respectively, or mode number0 and mode number 1 may be assigned to the DC mode and the planar mode,respectively. In this case, the intra prediction mode index of thecurrent block may be compared with the intra prediction mode numbersbelonging to the MPM group to determine the intra prediction mode of thecurrent block.

Then, the size of the prediction block is determined using informationindicating the transform size of the current block (S130).

When the size of the prediction block is equal to the size of thecurrent block, the prediction block is created using the intraprediction mode of the current block and the reference pixels of thecurrent block. The reference pixels are pixels reconstructed or createdpreviously to the current block.

When the size of the prediction block is smaller than the size of thecurrent block, that is, when the current block can be divided intoplural sub blocks and the intra prediction is performed thereon, thesame intra prediction mode (that is, the intra prediction mode of thecurrent block) is used to create the prediction block of each sub block.The prediction blocks of the second sub block or sub blocks subsequentthereto in the decoding order are created using the reconstructed pixelsof the preceding sub blocks. Therefore, after the prediction block, theresidual block, and the reconstructed block are created in the units ofsub blocks, the prediction block of the next sub block is created.

Then, it is determined whether the reference pixels of the blockcorresponding to the size of the prediction block are all valid (S140).The reference pixels are pixels which are previously decoded andreconstructed. When it is determined that at least one of the referencepixels is not valid, the reference pixel are created (S150).

Specifically, when it is determined that the reference pixels are notvalid at all, the reference pixel values are replaced with values of2L−1. Here, L represents the number of bits representing the gray scaleof luma components.

When valid reference pixels are present in only one direction withrespect to the position of the invalid reference pixel, the closestreference pixel out of the valid reference pixels is copied to createthe reference pixels.

When valid reference pixels are present in both directions with respectto the position of the invalid reference pixel, the reference pixellocated at the closest position in a predetermined direction can becopied or two closest reference pixels in both directions can beaveraged to create the reference pixels.

Then, it is determined whether the reference pixels should be filtered(S160). The reference pixels are adaptively filtered depending on thereconstructed intra prediction mode and the size of the prediction block(S170).

The reference pixels are not filtered when the intra prediction mode isthe DC mode. When the intra prediction modes are the vertical mode andthe horizontal mode, the intra prediction module 240 does not alsofilter the reference pixels. However, when the intra prediction modesare directional modes other than the vertical mode and the horizontalmode, the reference pixels are adaptively filtered depending on theintra prediction mode and the size of the prediction block. When thesize of the prediction block is 4×4, the reference pixels are notfiltered for the purpose of a decrease in complexity regardless of theintra prediction mode. The filtering serves to smooth the variation inpixel value between reference pixels and uses a low-pass filter. Thelow-pass filter may be [1, 2, 1] which is a 3-tap filter or [1, 2, 4, 2,1] which is a 5-tap filter. When the size of the prediction block rangesfrom 8×8 to 32×32, the reference pixels are filtered in more intraprediction modes with an increase in the size of the prediction block.

Then, the prediction block is created depending on the intra predictionmode (S180). The reference pixels used for the prediction block may bepixels which are adaptively filtered depending on the size of theprediction block and the intra prediction mode.

In the DC mode, the average values of N top reference pixels located atpositions of (x=0, . . . , N−1, y=−1), M left reference pixels locatedat positions of (x=1−, y=0, . . . , M−1), and the corner pixel locatedat a position of (x=−1, y=−1) can be determined as the prediction pixelsof the prediction block. However, the prediction pixels neighboring thereference pixels can be created using weighted average of the averagevalue and the reference pixel neighboring the prediction pixel. In theplanar mode, the prediction pixels can be created in the same was as inthe DC mode.

In the vertical mode, the reference pixels located in the verticaldirection are set to the prediction pixels. However, the predictionpixel neighboring the left reference pixel can be created using thereference pixel located in the vertical direction and the variationbetween the left reference pixels. The variation represents thevariation between the corner reference pixel and the left referencepixel neighboring the prediction pixel. In the horizontal mode, theprediction pixels can be created in the same way as in the verticalmode, except for the direction.

The method of encoding the intra prediction mode of the current block inthe moving image encoding device shown in FIG. 1 will be describedbelow. This method can be performed by the intra prediction module 110and the entropy encoding module 140 shown in FIG. 1.

First, the intra prediction mode of the current block is determined.

Then, the MPM group of the current block is created. The method ofcreating the MPM group is the same as creating the MPM group in theintra prediction mode 240 shown in FIG. 2 and thus will not bedescribed.

Subsequently, it is determined whether the intra prediction mode of thecurrent block belongs to the MPM group.

When the intra prediction mode belongs to the MPM group, a flag (thatis, the intra prediction mode group indicator) indicating the MPM groupand a prediction mode index indicating a specific intra prediction modein the MPM group are determined.

When the intra prediction mode does not belong to the MPM group, a flagnot indicating the MPM group and the prediction mode index indicatingthe specific intra prediction mode out of intra prediction modes(hereinafter, referred to as residual intra prediction modes) other thanthe intra prediction modes of the MPM group are determined.

The prediction mode index indicating the intra prediction mode of thecurrent block out of the residual intra prediction modes variesdepending on the configuration of the MPM group. That is, the predictionmode indices represent indices of the residual intra prediction modesrearranged depending on the configuration of the MPM group. Therefore,the prediction mode index is determined depending on the intraprediction mode of the current block and the intra prediction modesbelonging to the MPM group.

specifically, the residual intra prediction modes of the current blockcan be rearranged in the mode number order and the order of the intraprediction mode of the current block can be determined as the predictionmode index. Alternatively, the residual intra prediction modes may berearranged, but the intra prediction mode of the current block may bedetermined by comparison of the intra prediction mode numbers belongingto the MPM group with the intra prediction mode index of the currentblock.

This method can be applied to a case where mode number 2 is assigned tothe DC mode of the non-directional modes, mode number 34 is assigned tothe planar mode, and directional mode numbers are assigned to the othermodes. However, since the probability of selecting the planar mode andthe DC mode as the intra prediction mode of the current is higher thanthose of the other directional modes, a small mode number (for example,mode number 0) is assigned to the planar mode and the above-mentionedmethod can be applied. In this case, the mode numbers of the otherlower-ranked modes increase by 1. Alternatively, the lowest indices maybe assigned to the non-directional modes. For example, when the intraprediction mode of the current block is the planar mode and the residualintra prediction modes include the planar mode, the intra predictionmode index may include 0. For example, when the residual intraprediction modes include the planar mode and the DC mode, the intraprediction mode corresponding to the prediction mode index in a statewhere the planar mode, the DC mode, and the directional modes arearranged in this order may be set as the intra prediction mode of thecurrent block. For example, mode number 0 and mode number 1 may beassigned to the planar mode the DC mode, respectively, or mode number 0and mode number 1 may be assigned to the DC mode and the planar mode,respectively. In this case, the intra prediction mode index of thecurrent block may be compared with the intra prediction mode numbersbelonging to the MPM group to determine the intra prediction mode of thecurrent block.

While the invention has been described with reference to theembodiments, it will be able to be understood by those skilled in theart that the invention can be modified and changed in various formswithout departing from the spirit and scope of the invention describedin the appended claims.

The invention claimed is:
 1. An image encoding method comprising:determining an intra prediction mode of a current prediction unit;encoding the current prediction unit using the intra prediction mode;constructing a first group including three intra prediction modes usingvalid intra prediction modes of left and top blocks of the currentprediction unit; determining an intra prediction mode group indicatorand a prediction mode index of the current prediction unit; encoding theintra prediction mode group indicator and the prediction mode index, andwherein the intra prediction mode group indicator indicates whether theintra prediction mode of the current prediction unit belongs to thefirst group or a second group, and a method of encoding the predictionmode index varies depending on the intra prediction mode groupindicator.
 2. The method of claim 1, wherein a method of binarizing theprediction mode index varies depending on the intra prediction modegroup indicator.
 3. The method of claim 2, wherein when the intraprediction mode group indicator indicates the first group, theprediction mode index is binarized in a truncated unary manner and isthen entropy-encoded.
 4. The method of claim 1, wherein when a size ofthe current prediction unit is larger than a size of a transform unit, aplurality of prediction blocks included in the current prediction unitare created using the same intra prediction mode.
 5. The method of claim1, wherein when the intra prediction modes of the left and top blocks ofthe current prediction unit are not valid, the first group includes aplanar mode, a DC mode, and a vertical mode.
 6. The method of claim 1,wherein when the intra prediction modes of the left and top blocks arenot equal to each other and are directional intra prediction modes, thefirst group includes the intra prediction modes of the left and topblocks and a non-directional intra prediction mode.
 7. The method ofclaim 1, wherein mode numbers of directional intra prediction modes arelower than mode numbers of directional intra prediction modes.
 8. Themethod of claim 1, wherein the directional intra prediction modes are aplanar mode and a DC mode.